<template>
	<div id="container"></div>
</template>
<script>
	// import AMapLoader from "@amap/amap-jsapi-loader";

	export default {
		name: "map-view",
		data() {
			return{
				map: null,
			}
		},
		mounted() {
			this.initAMap();
		},
		methods: {
			initAMap() {
				if (!this.$AMap) {
					setTimeout(() => {
						this.initAMap();
					}, 100);
				}else{
					let AMap = this.$AMap;
					this.map = new AMap.Map("container", {
						// 设置地图容器id
						//viewMode: "3D", // 是否为3D地图模式
						zoom: 11, // 初始化地图级别
						//center: [116.400274, 39.905812], // 初始化地图中心点位置，缺省时默认定位到用户所在城市的中心
					});
					//console.log("AMap1=>", this.$AMap)
				}
			},


		},
	};
</script>
<style>
	#container {
		width: 100%;
		height: 100%;
	}
</style>